#ifndef __GIMBAL_BEHAVIOR_H
#define __GIMBAL_BEHAVIOR_H

#include "main.h"
#include "Gimbal_Task.h"

#define  GIMBAL_RED   	1
#define  GIMBAL_GREEN   0


#define  GIMBAL_Task   GIMBAL_BLUE


typedef enum
{
    GIMBAL_STOP_MODE = 0, //电机原始值控制
    GIMBAL_RESET_MODE=1, //电机编码值角度控制
	GIMBAL_RECT_MODE=2,
	GIMBAL_TRCK_MODE=3
} gimbal_behavior_e;


//pitch 像素环      PID参数以及 PID最大输出，积分输出
#define PITCH_PID_KP 2.0f          //2.0
#define PITCH_PID_KI 0.0f
#define PITCH_PID_KD 1.9f          //1.2  1.9
#define PITCH_PID_MAX_OUT 700.0f
#define PITCH_PID_MAX_IOUT 300.0f

//yaw 像素环      PID参数以及 PID最大输出，积分输出
#define YAW_PID_KP 2.0f
#define YAW_PID_KI 0.0f
#define YAW_PID_KD 1.9f         //1,8
#define YAW_PID_MAX_OUT 700.0f
#define YAW_PID_MAX_IOUT 300.0f


#define    PIXEL_DEADZONE       30
#define    PIXEL_TO_DELTA_DATA  0.007
#define    PIXEL_LOW_PASS       0.8                 //0.5

#define    ERROR_DEADZONE       8                  

#define    ERROR_MIN            20
#define    ERROR_MAX            20
#define    EEROR_ALL_MAX_2      242

#define    DELAY_CNT            400
#define    ERROR_ADD            0

void gimbal_behaviour_set_mode(Gimbal_Control_t *gimbal_set_mode);
void gimbal_behaviour_control_set(fp32 *add_yaw_angle, fp32 * add_pitch_angle, Gimbal_Control_t *gimbal_set_control);


#endif 
